#pragma once
#ifndef __AIALGORITHMINTERFACE_H
#define __AIALGORITHMINTERFACE_H

#ifdef COSMETICALGO_API_EXPORTS
#if defined(_MSC_VER)
#define COSMETICALGO_API __declspec(dllexport)
#else
#define COSMETICALGO_API __attribute__((visibility("default")))
#endif
#else

#if defined(_MSC_VER)
#define COSMETICALGO_API __declspec(dllimport)
#else
#define COSMETICALGO_API
#endif
#endif  // API_EXPORTS

#if NV_TENSORRT_MAJOR >= 8
#define TRT_NOEXCEPT noexcept
#define TRT_CONST_ENQUEUE const
#else
#define TRT_NOEXCEPT
#define TRT_CONST_ENQUEUE
#endif

#include <opencv2/opencv.hpp>

typedef struct YOLOResult_ {
	cv::Rect objectRect;
	float conf;  // bbox_conf * cls_conf
	float class_id;
}YOLOResult;

class AIAlgorithmInterface {
public:
	virtual ~AIAlgorithmInterface() {};//To avoid memory leaks
	virtual void init()=0;
	virtual	bool loadModel(std::string engine_name)=0;
	virtual void set_input_img_w(int _input_img_w_)=0;
	virtual void set_input_img_h_(int _input_img_h_)=0;
	virtual void set_conf_thresh(float _conf_thresh_)=0;
	virtual std::vector<YOLOResult> detect(cv::Mat img)=0;
	virtual int classify(cv::Mat img)=0;
	virtual std::vector<int> classify(std::vector<cv::Mat> imgs)=0;
};


#endif  // __AIALGORITHMINTERFACE_H